package com.Object.EqualsExercise;

/**
 * @Author 小闽
 * @Date 2024/8/14 16:51
 * @PackageName: com.Object.EqualsExercise
 * @ClassName: EqualsExercise03
 * @Description: 练习3
 * @Version 1.0
 */
public class EqualsExercise03 {
    public static void main(String[] args) {
        int it = 65;
        float fl = 65.0f;
        System.out.println("65和65.0f是否相等？" + (it == fl)); // true
        char ch1 = 'A';
        char ch2 = 12;
        System.out.println("65和'A'是否相等？" + (it == ch1));// true
        System.out.println("12和ch2是否相等？" + (12 == ch2)); // true

        String str1 = new String("hello");
        String str2 = new String("hello");
        System.out.println("str1和str2是否相等？" + (str1 == str2)); // false
        System.out.println("str是否equals str2？" + (str1.equals(str2))); // true
//        System.out.println("hello" == new java.sql.Date());
    }
}
